package com.ay.entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Item {
    private Integer id;

    private String name;

    private String pic;

    private String details;

    private Date creattime;

    private String strcreattime;


    public String getStrcreattime() {
        return strcreattime;
    }


    public void setStrcreattime(String strcreattime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date=null;
        try {
            date = sdf.parse(strcreattime);
            this.setCreattime(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.strcreattime = strcreattime;
    }

    private String price;

    public Item(Integer id, String name, String pic, String details, Date creattime, String strcreattime, String price) {
        this.id = id;
        this.name = name;
        this.pic = pic;
        this.details = details;
        this.creattime = creattime;
        this.strcreattime = strcreattime;
        this.price = price;
    }

    public Item(Integer id, String name, String pic, String details, Date creattime, String price) {
        this.id = id;
        this.name = name;
        this.pic = pic;
        this.details = details;
        this.creattime = creattime;
        this.price = price;
    }

    public Item() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic == null ? null : pic.trim();
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details == null ? null : details.trim();
    }

    public Date getCreattime() {

        return creattime;
    }


    public void setCreattime(Date creattime) {
       this.creattime=creattime;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price == null ? null : price.trim();
    }

    @Override
    public String toString() {
        return "Item{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pic='" + pic + '\'' +
                ", details='" + details + '\'' +
                ", creattime=" + creattime +
                ", strcreattime='" + strcreattime + '\'' +
                ", price='" + price + '\'' +
                '}';
    }
}